<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
    <meta name="author" content="Coderthemes">

    <link rel="shortcut icon" href="/static/admin/assets/images/favicon_1.ico">

    <title>忆创能力学院</title>

    <link href="/static/admin/assets/plugins/notifications/notification.css" rel="stylesheet">

    <link href="/static/admin/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/static/admin/assets/css/core.css" rel="stylesheet" type="text/css">
    <link href="/static/admin/assets/css/icons.css" rel="stylesheet" type="text/css">
    <link href="/static/admin/assets/css/components.css" rel="stylesheet" type="text/css">
    <link href="/static/admin/assets/css/pages.css" rel="stylesheet" type="text/css">
    <link href="/static/admin/assets/css/menu.css" rel="stylesheet" type="text/css">
    <link href="/static/admin/assets/css/responsive.css" rel="stylesheet" type="text/css">

    <script src="/static/admin/assets/js/modernizr.min.js"></script>


    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->


</head>
<body>


<div class="wrapper-page" id="login">
    <div class="panel panel-color panel-primary panel-pages">
        <div class="panel-heading bg-img">
            <div class="bg-overlay"></div>
            <h3 class="text-center m-t-10 text-white"> 登陆 <strong>忆创能力学院</strong> </h3>
        </div>


        <div class="panel-body">
            <form class="form-horizontal m-t-20" action="javascript:;">

                <div class="form-group">
                    <div class="col-xs-12">
                        <input class="form-control input-lg" v-model="form.username" type="text" required="" placeholder="用户名">
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-xs-12">
                        <input class="form-control input-lg" v-model="form.password" type="password" required="" placeholder="密码">
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-xs-12">
                        <div class="checkbox checkbox-primary">
                            <input id="checkbox-signup" type="checkbox">
                            <label for="checkbox-signup">
                                记住账户
                            </label>
                        </div>

                    </div>
                </div>

                <div class="form-group text-center m-t-40">
                    <div class="col-xs-12">
                        <button class="btn btn-primary btn-lg w-lg waves-effect waves-light" @click="login" type="submit">登陆</button>
                    </div>
                </div>

<!--                <div class="form-group m-t-30">-->
<!--                    <div class="col-sm-7">-->
<!--                        <a href="recoverpw.html"><i class="fa fa-lock m-r-5"></i> Forgot your password?</a>-->
<!--                    </div>-->
<!--                    <div class="col-sm-5 text-right">-->
<!--                        <a href="register.html">Create an account</a>-->
<!--                    </div>-->
<!--                </div>-->
            </form>
        </div>

    </div>
</div>


<script>
  var resizefunc = [];
</script>

<!-- Main  -->
<script src="/static/admin/assets/js/jquery.min.js"></script>
<script src="/static/admin/assets/js/bootstrap.min.js"></script>
<script src="/static/admin/assets/js/detect.js"></script>
<script src="/static/admin/assets/js/fastclick.js"></script>
<script src="/static/admin/assets/js/jquery.slimscroll.js"></script>
<script src="/static/admin/assets/js/jquery.blockUI.js"></script>
<script src="/static/admin/assets/js/waves.js"></script>
<script src="/static/admin/assets/js/wow.min.js"></script>
<script src="/static/admin/assets/js/jquery.nicescroll.js"></script>
<script src="/static/admin/assets/js/jquery.scrollTo.min.js"></script>
<script src="/static/admin/assets/js/jquery.app.js"></script>
<script src="/static/admin/assets/plugins/notifyjs/dist/notify.min.js"></script>
<script src="/static/admin/assets/plugins/notifications/notify-metro.js"></script>
<script src="/static/admin/assets/plugins/notifications/notifications.js"></script>
<script src="/static/js/vue.js"></script>
<script>
    $(function () {
        var vm  = new Vue({
          el:"#login",
          data:{
            form:{
              username:"",
              password:""
            }
          },
          methods:{
            login(){
              if(this.form.username && this.form.password) {
                $.post('/common/loginIn',this.form).then(function (data) {
                  console.log(data);
                  if(data.errno===0){
                    $.Notification.notify('success','top center', '登陆提示', data.data)
                    location.href = '/index/index'
                  }else{
                    $.Notification.notify('error','top center', '登陆提示', data.message)
                  }
                },function (err) {
                  $.Notification.notify('error','top center', '登陆提示', err)
                })
              }else{
                $.Notification.notify('error','top center', '登陆提示', '用户名密码不能为空')
              }
              return false;
            }
          }
        })
    })
</script>

</body>
</html>
